<template>
  <div :class="'page-' + urlFrom">
    <div v-if="getShowBuyCard && getVeekrayStatus === 1 && !checkOwner && getCustomerId" class="back-my-shop box-shadow fixed-btn">
      <button class="button-icon" @click="backShop">
        <div class="font-11">
          <p>回我</p>
          <p>店铺</p>
        </div>
      </button>
    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {}
    },
    props: {
      urlFrom: {
        type: String,
        default: ''
      }
    },
    onShow() {},
    methods: {
      backShop() {
        this.$pt.removeStorageSync('otherShop')
        this.$pt.setStorageSync('personalType', 1)
        this.$utils.setMyId(this.getCustomerId)
        this.$root.$mp.appOptions.query = {}
        if (this.getCurrentPage().page.route === 'pages/shop/detail/main') {
          this.$pt.reLaunch({url: '/pages/home/main'})
          return
        }
        this.$pt.reLaunch({url: '/' + this.getCurrentPage().page.route})
      }
    }
  }
</script>

<style scoped lang="less">
  // 返回我的店铺按钮
  .page-home{
    .back-my-shop {
      bottom: 157px;
    }
  }
  .page-shop, .page-personal{
    .back-my-shop {
      bottom: 40px;
    }
  }
  .back-my-shop {
    z-index: 100;
    position: fixed;
    bottom: 205px;
    right: 13px;
    background: linear-gradient(90deg, #00b3f5, #0079f7);
    border-radius: 100px;
    width: 48px;
    height: 48px;
    text-align: center;
    .button-icon{
      color: #fff;
      height: 48px;
      line-height: 1.2;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
</style>
